<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String realPath = this.getServletContext().getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>首页 - ${global.titleSuffix }</title>
<jsp:include page='<%="/header"%>' />
</head>
<link href="<%=realPath%>/resources/css/web/index.css" type="text/css"
	rel="stylesheet">
<body>
	<div id="container">
		<%--主体分为两部分--%>
		<div id="left-list">
			<jstl:forEach items="${articleInfos }" var="info">
				<article class="list-article radius">
					<h1 class="article-title">
						<a href="<%=realPath%>/article/${info.articleId }">${info.title }</a>
					</h1>
					<p class="article-content">${info.beviaryContent }</p>
				</article>
			</jstl:forEach>
			<%--
                	作者：1249146043@qq.com
                	时间：2015-02-12
                	描述：分页部分
                --%>
			<div class="list-article radius paging">
				<ul>
					<li><a href="<%=realPath%>/page/${pageIndex -1 }">上一页</a></li>
					<jstl:forEach var="i" begin="1"
						end="${(global.articlesCount+10) / 10 }">
						<jstl:if test="${i <= 10 }">
							<li><a href="<%=realPath%>/page/${i }">${i }</a></li>
						</jstl:if>
					</jstl:forEach>
					<li><a href="<%=realPath%>/page/${pageIndex +1 }">下一页</a></li>
				</ul>
			</div>
			<%-- 分页部分 --%>
		</div>
		<div id="right-sidebar">
			<div id="sidebar-body">
				<article id="article-search" class="radius">
					<h1>搜索</h1>
				</article>
				<article id="article-top" class="radius">
					<h1>热门文章</h1>
					<p>
					<ul class="list">
						<jstl:forEach items="${hotArticles }" var="hot">
							<li><a href="<%=realPath%>/article/${hot.articleId }">${hot.title }</a></li>
						</jstl:forEach>
					</ul>
					</p>
				</article>
				<article id="command-new" class="radius">
					<h1>新评论</h1>
					<p>
					<ul class="list">
						<jstl:forEach items="${newComments }" var="comment">
							<li><a href="">${comment.content }</a></li>
						</jstl:forEach>
					</ul>
					</p>
				</article>
				<article id="blog_ad" class="radius">
					<h1>广告</h1>
				</article>
				<article id="friend-links" class="radius">
					<h1>友情链接</h1>
				</article>
			</div>
		</div>
	</div>
	<jsp:include page='<%="/footer"%>' />
</body>
</html>